CMAKE_MINIMUM_REQUIRED( VERSION 2.6 FATAL_ERROR )
include(../cmake/common.cmake)

FILE(GLOB test_sources "*_test.cc")
FILE(GLOB lib_sources "*.cpp")
LIST(REMOVE_ITEM lib_sources ${test_sources})

ADD_LIBRARY(pugixml STATIC ${lib_sources})

FOREACH(test_src ${test_sources})
  GET_FILENAME_COMPONENT(test_exe ${test_src} NAME_WE)
  MESSAGE("Add test case : ${test_exe}")
  ADD_EXECUTABLE(${test_exe} EXCLUDE_FROM_ALL ${test_src})
  TARGET_LINK_LIBRARIES(${test_exe} pugixml gtest pthread)
ENDFOREACH(test_sources)

